@{
    // list all articles;
    var ArticleList = "~/Views/Admin/_ListAllArticlesView.cshtml";
    var orderBy = Request.QueryString["orderBy"];
    var SortBy = Request.QueryString["SortBy"] == "ASC" ? "ASC" : "DESC" ;
    var Articles = Blog.DataObject.GetAllArticles(orderBy,SortBy);
    SortBy = SortBy == "ASC" ? "DESC" : "ASC";
    var Categories = Blog.DataObject.GetCategories();
    var ArticleGrid = new WebGrid(Articles);
}
@*ObjectInfo.Print(this)*@
@RenderPage(ArticleList,new{Articles=Articles,Categories=Categories,ArticleGrid=ArticleGrid,SortBy=SortBy})

